<template>
	<view>
		<classifyList :hideTitle="true" :classifyListData="list"></classifyList>
		<view class="cu-load" :class="!pullUpOn?'loading':'over'"></view>
	</view>
</template>

<script>
	import classifyList from '../../components/classifyList.vue'
	export default {
		components: {
			classifyList
		},
		data() {
			return {
				list: [],
				pullUpOn: false,
				pages: 1,
				limit: 6
			};
		},
		onLoad() {
			this.getUserFollowMenu()
		},
		methods: {
			getUserFollowMenu() {
				if (this.pullUpOn) return;
				this.$api.getUserFollowMenu({
					page: this.pages,
					limit: this.limit
				}).then(res => {
					if (res.code) {
						this.pages++
						this.list.push(...res.data);
						if (!res.data.length || res.data.length < this.limit) {
							this.pullUpOn = true
						}
					} else {
						this.pullUpOn = false
					}
				})
			}
		}
	}
</script>

<style lang="scss">

</style>
